<?php
$host = 'h50mysql103.secureserver.net';
$user = 'inklamp';
$pass = 'AMPpr1me';
$db = 'inklamp';
$table = 'trials001';
$file = 'export';

$link = mysql_connect($host, $user, $pass) or die("Can not connect." . mysql_error());
mysql_select_db($db) or die("Can not connect.");

$csv_output.="{";

$values = mysql_query("SELECT * FROM ".$table."");
while ($rowr = mysql_fetch_row($values)) {
	$csv_output .= "\"".$rowr[0]."\": ";
	$csv_output .= $rowr[1]."\n";
}

$csv_output.="}";



$filename = $file."_".date("Y-m-d_H-i",time());
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header( "Content-disposition: filename=".$filename.".csv");
print $csv_output;
exit;
?>